package 杂项和预实验;

import 学生.Student;
import 数据库和网络.myDatebase;
import GUI.*;
import java.sql.SQLException;

public class DataBaseQuery {

    public static void main(String[] args) {
        String currentClass;
        enterWindow.currentStudent=new Student();
        enterWindow.currentStudent.setMyClass("adminClass");
        currentClass=enterWindow.currentStudent.getMyClass();
        myDatebase paperDateBase=new myDatebase("papercollection");
        String demo="select TABLE_NAME from information_schema.TABLES where TABLE_NAME='"+currentClass+"'";
        String sql="";
        try {

            paperDateBase.statement.execute(demo);
            paperDateBase.resultSet=paperDateBase.statement.executeQuery(sql);
            while(paperDateBase.resultSet.next()){
                System.out.println(paperDateBase.resultSet.getString(1));
            }
        } catch (SQLException throwables) {
            throwables.printStackTrace();
        }
    }
}
